package com.cedric.yixianpai.game.cards.Sects.swordCards.a_LianQi;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class JuHuLingJian extends SwordCard {
    /**
     * 巨虎灵剑 10/13/16
     */
    public JuHuLingJian(@Value("1") int lvl) {
        super("巨虎灵剑");
        this.setCardType(CardType.LING);
        this.setLevel(lvl);
        this.setPeriod(Period.LIANQI);
        this.setDescription(" 10/13/16攻");

        this.setSpiritNeed(1);
        if (1 == lvl) {
            this.setDamage(10);
        } else if (2 == lvl) {
            this.setDamage(13);
        } else if (3 == lvl) {
            this.setDamage(16);
        } else {
            throw new RuntimeException("错误的卡牌等级！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        if(Sta1.spiritEnough(this.getSpiritNeed())){
            Sta1.attack(Sta2,this.getDamage());
            Sta1.getPlayerBuff().setSwordIntent(0);
            return true;
        }
        else{
            return false;
        }
    }
}
